# -*- coding: utf-8 -*-

###########################################################################
## Python code generated with wxFormBuilder (version 3.10.0-4761b0c)
## http://www.wxformbuilder.org/
##
## PLEASE DO *NOT* EDIT THIS FILE!
###########################################################################

import wx
import wx.xrc
import wx.grid

###########################################################################
## Class MainFrame
###########################################################################

class MainFrame ( wx.Frame ):

	def __init__( self, parent ):
		wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = u"Diffraction of light", pos = wx.DefaultPosition, size = wx.Size( 504,363 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )

		self.SetSizeHints( wx.DefaultSize, wx.DefaultSize )

		bSizer1 = wx.BoxSizer( wx.VERTICAL )


		bSizer1.Add( ( 0, 0), 1, wx.EXPAND, 5 )

		self.m_gridData = wx.grid.Grid( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0 )

		# Grid
		self.m_gridData.CreateGrid( 3, 4 )
		self.m_gridData.EnableEditing( True )
		self.m_gridData.EnableGridLines( True )
		self.m_gridData.EnableDragGridSize( False )
		self.m_gridData.SetMargins( 0, 0 )

		# Columns
		self.m_gridData.SetColSize( 0, 100 )
		self.m_gridData.SetColSize( 1, 100 )
		self.m_gridData.SetColSize( 2, 100 )
		self.m_gridData.SetColSize( 3, 100 )
		self.m_gridData.EnableDragColMove( False )
		self.m_gridData.EnableDragColSize( True )
		self.m_gridData.SetColLabelValue( 0, u"θ1L" )
		self.m_gridData.SetColLabelValue( 1, u"θ1R" )
		self.m_gridData.SetColLabelValue( 2, u"θ2L" )
		self.m_gridData.SetColLabelValue( 3, u"θ2R" )
		self.m_gridData.SetColLabelValue( 4, wx.EmptyString )
		self.m_gridData.SetColLabelSize( wx.grid.GRID_AUTOSIZE )
		self.m_gridData.SetColLabelAlignment( wx.ALIGN_CENTER, wx.ALIGN_CENTER )

		# Rows
		self.m_gridData.SetRowSize( 0, 50 )
		self.m_gridData.SetRowSize( 1, 50 )
		self.m_gridData.SetRowSize( 2, 50 )
		self.m_gridData.EnableDragRowSize( True )
		self.m_gridData.SetRowLabelValue( 0, u"第一次" )
		self.m_gridData.SetRowLabelValue( 1, u"第二次" )
		self.m_gridData.SetRowLabelValue( 2, u"第三次" )
		self.m_gridData.SetRowLabelValue( 3, wx.EmptyString )
		self.m_gridData.SetRowLabelSize( wx.grid.GRID_AUTOSIZE )
		self.m_gridData.SetRowLabelAlignment( wx.ALIGN_CENTER, wx.ALIGN_CENTER )

		# Label Appearance

		# Cell Defaults
		self.m_gridData.SetDefaultCellAlignment( wx.ALIGN_CENTER, wx.ALIGN_CENTER )
		bSizer1.Add( self.m_gridData, 0, wx.ALL|wx.EXPAND, 5 )


		bSizer1.Add( ( 0, 0), 1, wx.EXPAND, 5 )

		bSizer5 = wx.BoxSizer( wx.HORIZONTAL )

		self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"θ->", wx.DefaultPosition, wx.DefaultSize, 0 )
		self.m_staticText1.Wrap( -1 )

		bSizer5.Add( self.m_staticText1, 0, wx.ALL, 5 )

		self.m_textCtrlTheta = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_READONLY )
		bSizer5.Add( self.m_textCtrlTheta, 0, wx.ALL, 5 )

		self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, u"Sin(θ)->", wx.DefaultPosition, wx.DefaultSize, 0 )
		self.m_staticText2.Wrap( -1 )

		bSizer5.Add( self.m_staticText2, 0, wx.ALL, 5 )

		self.m_textCtrlSin = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_READONLY )
		bSizer5.Add( self.m_textCtrlSin, 0, wx.ALL, 5 )

		self.m_buttonCalculate = wx.Button( self, wx.ID_ANY, u"Calculate", wx.DefaultPosition, wx.DefaultSize, 0 )
		bSizer5.Add( self.m_buttonCalculate, 0, wx.ALL, 5 )


		bSizer1.Add( bSizer5, 1, wx.ALL|wx.EXPAND, 5 )


		bSizer1.Add( ( 0, 0), 1, wx.EXPAND, 5 )

		bSizer6 = wx.BoxSizer( wx.HORIZONTAL )

		self.m_staticText8 = wx.StaticText( self, wx.ID_ANY, u"λ(nm)<->", wx.DefaultPosition, wx.DefaultSize, 0 )
		self.m_staticText8.Wrap( -1 )

		bSizer6.Add( self.m_staticText8, 0, wx.ALL, 5 )

		self.m_textCtrlLambda = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_PROCESS_ENTER )
		bSizer6.Add( self.m_textCtrlLambda, 0, wx.ALL, 5 )

		self.m_staticText9 = wx.StaticText( self, wx.ID_ANY, u"d(μm)<->", wx.DefaultPosition, wx.DefaultSize, 0 )
		self.m_staticText9.Wrap( -1 )

		bSizer6.Add( self.m_staticText9, 0, wx.ALL, 5 )

		self.m_textCtrlD = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_PROCESS_ENTER )
		bSizer6.Add( self.m_textCtrlD, 0, wx.ALL, 5 )


		bSizer1.Add( bSizer6, 1, wx.ALL|wx.EXPAND, 5 )

		self.m_staticText10 = wx.StaticText( self, wx.ID_ANY, u"Please input data in the grid in format like \"100+20\" representing 100°20′.\nAnd if you modify λ it will calculate d after pressing ENTER, vice versa.", wx.DefaultPosition, wx.DefaultSize, 0 )
		self.m_staticText10.Wrap( -1 )

		bSizer1.Add( self.m_staticText10, 0, wx.ALL, 5 )


		bSizer1.Add( ( 0, 0), 1, wx.EXPAND, 5 )


		self.SetSizer( bSizer1 )
		self.Layout()
		self.m_menubar1 = wx.MenuBar( 0 )
		self.m_menu1 = wx.Menu()
		self.m_menuItemExport = wx.MenuItem( self.m_menu1, wx.ID_ANY, u"Export", wx.EmptyString, wx.ITEM_NORMAL )
		self.m_menu1.Append( self.m_menuItemExport )

		self.m_menuItemImport = wx.MenuItem( self.m_menu1, wx.ID_ANY, u"Import", wx.EmptyString, wx.ITEM_NORMAL )
		self.m_menu1.Append( self.m_menuItemImport )

		self.m_menubar1.Append( self.m_menu1, u"File" )

		self.SetMenuBar( self.m_menubar1 )


		self.Centre( wx.BOTH )

		# Connect Events
		self.m_buttonCalculate.Bind( wx.EVT_BUTTON, self.m_buttonCalculateOnButtonClick )
		self.m_textCtrlLambda.Bind( wx.EVT_TEXT_ENTER, self.m_textCtrlLambdaOnTextEnter )
		self.m_textCtrlD.Bind( wx.EVT_TEXT_ENTER, self.m_textCtrlDOnTextEnter )
		self.Bind( wx.EVT_MENU, self.m_menuItemExportOnMenuSelection, id = self.m_menuItemExport.GetId() )
		self.Bind( wx.EVT_MENU, self.m_menuItemImportOnMenuSelection, id = self.m_menuItemImport.GetId() )

	def __del__( self ):
		pass


	# Virtual event handlers, override them in your derived class
	def m_buttonCalculateOnButtonClick( self, event ):
		event.Skip()

	def m_textCtrlLambdaOnTextEnter( self, event ):
		event.Skip()

	def m_textCtrlDOnTextEnter( self, event ):
		event.Skip()

	def m_menuItemExportOnMenuSelection( self, event ):
		event.Skip()

	def m_menuItemImportOnMenuSelection( self, event ):
		event.Skip()


